<template>
  <el-select
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
    placeholder="请选择"
  >
    <el-option
      v-for="(item, index) in channeldata"
      :key="index"
      :label="item.channelname"
      :value="item.channelname"
    />
  </el-select>
</template>

<script setup>
import { articlechannelservice } from '@/api/article.js'
import { ref } from 'vue'
let channeldata = ref([])
const getchanneldata = async () => {
  const res = await articlechannelservice()
  channeldata.value = res.data.channeldata
}
getchanneldata()
defineProps({
  modelValue: {
    type: [Number, String]
  }
})
const emit = defineEmits(['update:modelValue'])
</script>

<style scoped lang="less"></style>
